<!-- 利润表页面 -->
<template>
  <div class="padding" v-loading="loading">
    <el-card>
      <div slot="header" class="clearfix">
        <span class="text-df">利润异常检查</span>
      </div>
      <el-form
        size="mini"
        class="padding-top-sm flex justify-between"
        :inline="true"
        :model="searchCriteria"
      >
        <el-form-item label="月份" prop="peroid">
          <el-date-picker
            type="month"
            style="width: 220px"
            v-model="searchCriteria.month"
            value-format="yyyy-MM"
            placeholder="请选择月份"
          ></el-date-picker>
        </el-form-item>
        <el-button-group>
          <el-button size="mini" type="primary" v-loading.fullscreen.lock="fullscreenLoading" @click="statisticsRrofitRate">执行</el-button>

        </el-button-group>
      </el-form>
    </el-card>
  </div>
</template>
<script>
import { ajax } from "@/store/yg/common/utils";
import { m } from "@/store/yg/common/local";
import FileSaver from "file-saver";
import XLSX from "xlsx";
export default {
  data() {
    return {
      loading: false,
      fullscreenLoading: false,
      searchCriteria: {
        month: ""
      }
    };
  },
  mounted() {
  },
  methods: {
    statisticsRrofitRate(){
      this.fullscreenLoading = true;
      ajax("profitRate", this.searchCriteria).then(
        res => {
          console.log(res);
          this.fullscreenLoading = false;
          if (res.code != 200) {
            this.$message.error("操作失败，" + res.message);
          } else {
            this.$message.success("操作成功");
          }
        },
        error => {
          console.log(error);
          this.fullscreenLoading = false;
        }
      );
    }

  }
};
</script>
